package cn.bdqn.sptparent.web.controller;

import cn.bdqn.sptparent.common.util.RedisUtil;
import cn.bdqn.sptparent.domain.Result;
import cn.bdqn.sptparent.domain.param.LoginParam;
import cn.bdqn.sptparent.web.mq.MQMessage;
import cn.bdqn.sptparent.web.mq.MQSender;
import com.baomidou.mybatisplus.extension.api.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("mq")
public class MQController {
    @Resource
    MQSender mqSender;

    @GetMapping("login")
    public Result test3(){
        LoginParam loginParam = new LoginParam("张三","admin","22sA");
        mqSender.sendToken(new MQMessage<LoginParam>("user:id:"+loginParam.getUsername(),loginParam));
        return Result.ok();
    }
}
